﻿using CodeFinder.Common.Entities;
using CodeFinder.Common.Interfaces;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeFinder.Bussiness.Concretes {
    public class UserService : IUserService {
        private IRepository<User> m_userRepository;
        public UserService()
            : this(new CodeFinderModelContainer()) {

        }
        public UserService(DbContext context) {
            m_userRepository = new Repository<User>(context);
        }
        public Common.Entities.User FindUserById(long id) {
            throw new NotImplementedException();
        }

        public bool Login(string username, string password) {
            return m_userRepository.GetAll().Any(x => x.Username == username && x.Password == password);
        }

        public bool Save(Common.Entities.User user) {
            throw new NotImplementedException();
        }

        public bool Update(Common.Entities.User user) {
            throw new NotImplementedException();
        }

        public int Delete(long userId) {
            throw new NotImplementedException();
        }

        public void Dispose() {
            throw new NotImplementedException();
        }
    }
}
